var app=angular.module('myApp',['ui.router']);

app.config(['$stateProvider','$locationProvider','$urlRouterProvider',
    function($stateProvider,$locationProvider,$urlRouterProvider){
        $locationProvider.hashPrefix('');
        $urlRouterProvider.otherwise('/index');
        $stateProvider
            .state('index',{
                url:'/index',
                views:{
                    "mainView":{
                        templateUrl:'./templates/goodsList.tpl.html',
                        controller:'index.ctrl'
                }
            }
        })
            .state('login',{
                url:'/login',
                views: {
                    "mainView": {
                        templateUrl: './templates/login.tpl.html',
                        controller: 'users.ctrl'
                    }
                }
            })
            .state('register',{
                url:'/register',
                views: {
                    "mainView": {
                        templateUrl: './templates/register.tpl.html',
                        controller: 'cart.ctrl'
                    }
                }
            })
            .state('category',{
                url:'/index?type',
                views:{
                    "mainView":{
                        templateUrl:'./templates/category.tpl.html',
                        controller:'index.ctrl'
                    }
                }
            })
            .state('cart',{
                url:'/cart',
                views: {
                    "mainView": {
                        templateUrl: './templates/cart.tpl.html',
                        controller: 'cart.ctrl'
                    }
                }
            })
            .state('settlement',{
                url:'/settlement',
                views: {
                    "mainView": {
                        templateUrl: './templates/settlement.tpl.html',
                        controller: 'settlement.ctrl'
                    }
                }
            })
            .state('detail',{
                url:'/detail?title',
                views:{
                    "mainView":{
                        templateUrl:'./templates/detail.tpl.html',
                        controller:'detail.ctrl'

                    }
                }
            })
            .state('goodslist',{
                url:'/goodslist',
                views: {
                    "mainView": {
                        templateUrl: './templates/goodslist.tpl.html',
                        controller: 'goodslist.ctrl'
                    }
                }
            })
            .state('myorder',{
                url:'/myorder',
                views: {
                    "mainView": {
                        templateUrl: './myorder.html',
                        controller: 'myorder.ctrl'
                    }
                }
            })
            .state('ordersList',{
                url:'/ordersList',
                views: {
                    "mainView": {
                        templateUrl: './templates/cart.tpl.html',
                        controller: 'shopCart.ctrl'
                    }
                }
            })

    }]);
